//冒泡排序函数封装
function bubbleSorting(sum) {
    for (var i = 0; i <= sum.length - 1; i++) {
        for (var j = 0; j <= sum.length - 1 - i; j++) {
            if (sum[j] > sum[j + 1]) {
                temp = sum[j];
                sum[j] = sum[j + 1];
                sum[j + 1] = temp;
            }
        }
    }
    return sum;
}

var re = bubbleSorting([5, 6, 99, 3, 4, 55, 44, 23]);
console.log(re);